package com.eam.asset.assetApplication.controller;

import com.eam.asset.assetApplication.service.IDisposalCategoryService;
import com.eam.common.core.controller.BaseController;
import com.eam.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Validated
@RequestMapping("/asset/disposal")
@Api(tags = "处置分类控制器")
public class DisposalCategoryController extends BaseController {
    private final IDisposalCategoryService disposalCategoryService;

    //构造器注入
    @Autowired
    public DisposalCategoryController(IDisposalCategoryService disposalCategoryService) {
        this.disposalCategoryService = disposalCategoryService;
    }

    @GetMapping("/category")
    @PreAuthorize("@ss.hasPermi('asset:assetApplication:query')")
    @ApiOperation(value = "获取资产来源(处置方式)")
    public AjaxResult getDisposalCategoryList() {
        return success(disposalCategoryService.getDisposalCategoryList());
    }
}
